package com.yuyou.tas.lesson.mapper;

import com.yuyou.tas.service.api.lesson.dto.LessonChapterPageDTO;
import com.yuyou.tas.service.api.lesson.entity.LessonChapter;
import com.yuyou.tas.util.bean.Pagination;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LessonChapterMapper {
    int deleteByPrimaryKey(Long id);

    int insert(LessonChapter record);

    LessonChapter selectByPrimaryKey(Long id);

    LessonChapter selectByPKandOrgan(@Param(value="id") Long id,@Param(value="authOrganizationId") Long authOrganizationId);
    
    int updateByPrimaryKeySelective(LessonChapter record);
    
    int findLessonChapterCount(Pagination<LessonChapterPageDTO> queryPgn);
    
    List<LessonChapterPageDTO> findLessonChapterPageList(Pagination<LessonChapterPageDTO> queryPgn);
    
    List<LessonChapter> findLessonChapterByLessId(Long lessonId);
    
    Integer selectMaxSort(Long lessonId);
    
    List<LessonChapter> findByLessonId7Sort(@Param(value="lessonId")Long lessonId,@Param(value="sort")Integer sort);

    List<String> findBaseChaInLesson(@Param(value = "baseChapterId") Long baseChapterId);

    Integer findCountByBaseCha(@Param(value = "baseChapterId") Long baseChapterId);

    void delByless(@Param(value="lessonId")Long lessonId);
    
}